import request from '@/utils/request'

// 查询理货报告列表
export function listTally(query) {
  return request({
    url: '/manifest/tally/list',
    method: 'get',
    params: query
  })
}

// 查询理货报告详细
export function getTally(id) {
  return request({
    url: '/manifest/tally/' + id,
    method: 'get'
  })
}

// 新增理货报告
export function addTally(data) {
  return request({
    url: '/manifest/tally',
    method: 'post',
    data: data
  })
}

// 修改理货报告
export function updateTally(data) {
  return request({
    url: '/manifest/tally',
    method: 'put',
    data: data
  })
}

// 删除理货报告
export function delTally(id) {
  return request({
    url: '/manifest/tally/' + id,
    method: 'delete'
  })
}

// 导出理货报告
export function exportTally(query) {
  return request({
    url: '/manifest/tally/export',
    method: 'get',
    params: query
  })
}

// 申报理货报告
export function declareTally(ids) {
  return request({
    url: '/manifest/tally/declare/' + ids,
    method: 'put'
  })
}

// 构建收费单数据
export function buildChargeData(data) {
  return request({
    url: '/manifest/tally/buildChargeData',
    method: 'post',
    data: data
  })
}

// 生成收费单
export function generateCharge(data) {
  return request({
    url: '/manifest/tally/generateCharge',
    method: 'post',
    data: data
  })
}

// 生成运抵收费单
export function generateTallyFee(data) {
  return request({
    url: '/charge/createChargeOrder',
    method: 'post',
    data: data
  })
}
